package com.robot.orders.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.robot.orders.pojo.Confirmation;

/**
 * confirmation数据访问接口
 *
 * @author lin
 */
public interface ConfirmationDao extends JpaRepository<Confirmation, String>, JpaSpecificationExecutor<Confirmation> {
    /**
     * 根据agentId查询采购付款凭证列表
     *
     * @param agentId
     * @param pageable
     * @return
     */
    public Page<Confirmation> findAllByAgentIdAndDeletedAtIsNullOrderByCreatedAtDesc(String agentId, Pageable pageable);

    /**
     * 根据agentId和status查询采购付款凭证列表
     *
     * @param agentId
     * @param status
     * @param pageable
     * @return
     */
    public Page<Confirmation> findAllByAgentIdAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(String agentId, String status, Pageable pageable);
}
